# 函数的嵌套

def func01():
    print("...")
    def func001():
        print("11111111")
        return 0

    func001()
    return 1

def func02():
    print("2222")
    func01()



"""
1!+2!+3!+...+10!
n! = 1*2*3*...n
1+2+3+...+n

10!+11!+12!+...+20!
"""
def fun1(n):
    res = 1
    i = 1
    while i <= n:
        res = res * i  # res *= i
        i += 1
    return res

def fun2(i,k):
    res01 = 0
    # i = 10
    while i <= k:
        res01 = res01 + fun1(i)  # res01 += fun1(i)
        i += 2
    return res01

# def func03(n):
#     print(".....")
#     # func03(1)
#     func04(1)
#
# def func04(n):
#     func03(1)
#     print("[[[]]]")

def fun05(n):
    if n == 1:
        return 1
    elif n == 2:
        return 1
    else:
        return fun05(n - 1) + fun05(n - 2)

def fun_test():
    print("*******************")

# fun_test()
if __name__ == '__main__':
    # result = fun2(10,20)
    # result1 = fun2(16,34)
    # print(result)
    # print(result1)
    # func01()
    # func03(1)
    res = fun05(5)
    # print(res)
    fun_test()